/**
 * Created by cjd on 2016/6/12.
 */
angular.module("app").controller("group.activityList.Ctrl", ["$scope", "activitySign","$stateParams", function ($scope,activitySign,$stateParams) {
    $scope.activityGridConfig = {
        bindingOptions: {
            selectedRowKeys: "selectedItems",
            dataSource: "activityGridConfig.dataSource"
        },
        twoWayBindingEnabled: false,
        searchPanel: {
            visible: true,
            width: 200,
            placeholder: "输入关键字进行查询"
        },
        paging: {
            pageSize: 15
        },
        groupPanel: {
            visible: true,
            emptyPanelText: "拖动列名进行分组和排序"
        },
        hoverStateEnabled: true,
        showBorders: true,
        showRowLines: true,
        rowAlternationEnabled: true,
        noDataText: "没有数据",
        columns: [{
            dataField: "realName",
            alignment: "center",
            width:200,
            caption: "昵称"
        }, {
            dataField: "nickName",
            alignment: "center",
            width:200,
            caption: "真名"
        }, {
            dataField: "name",
            alignment: "center",
            caption: "活动名称"
        }, {
            dataField: "times",
            alignment: "center",
            width:200,
            caption: "公益时间"
        }]
    };
    $scope.getList = function (userId) {
        activitySign.listByUser({}, {userId: userId}, function (data) {
            if (data.statusCode == 0) {
                $scope.activityGridConfig.dataSource = data.data;
            }
        });
    };
    $scope.getList($stateParams.userId);
}]);